from django.conf import settings

DYNAMIC_SETTINGS_MISSING = "The setting DYNAMIC_APPS_ROOT is not declared. It is necessary if you will use the django-dynamic application"

try:
    DYNAMIC_APPS_ROOT = settings.DYNAMIC_APPS_ROOT
except:
    DYNAMIC_APPS_ROOT = None
    print DYNAMIC_SETTINGS_MISSING

try:
    DYNAMIC_PROJECT_ROOT = settings.DYNAMIC_PROJECT_ROOT
except:
    DYNAMIC_PROJECT_ROOT = None
    print DYNAMIC_SETTINGS_MISSING

DYNAMIC_PUBLIC_FILES_PATTERN = getattr(settings, 'DYNAMIC_PUBLIC_FILES_PATTERN', '*')
DYNAMIC_TEXTAREA_HEIGHT = getattr(settings, 'DYNAMIC_TEXTAREA_HEIGHT', '300px')

DYNAMIC_REPOSITORY_ROOT = getattr(settings, 'DYNAMIC_REPOSITORY_ROOT', DYNAMIC_PROJECT_ROOT)
DYNAMIC_REPOSITORY_GIT_PATH = '.git'
DYNAMIC_REPOSITORY_SUBVERSION_PATH = '.svn'
DYNAMIC_REPOSITORY_BAZAAR_PATH = '.bzr'

FILE_TYPES_BY_EXTENSION = {
    '': 'Unknown File Type',
    'py': 'Python Source',
    'pyc': 'Python ByteCode',
    'html': 'HTML File',
}
